export default function (json) {
  var loadedIndex = 0,							//当前load指针
    loadedNum = 0,								//已经加载的图片数量
    imagesLen = json.list.length,	//要加载的图片数量
    placeholder = "";
  //补充百分比
  if (json.perfect == !0) {
    if (imagesLen < 100) {
      for (var a = 0, l = 100 - imagesLen; a < l; a++) { json.list.push(placeholder); }
      imagesLen = 100;
    }
  };
  function loadAfter(img) {
    loadedNum++;
    var percent = loadedNum / imagesLen;
    if (json.perLoad !== undefined) {
      json.perLoad(Math.round(percent.toFixed(2) * 100), img.src, img);
    }
    if (json.finish !== undefined && percent >= 1) { json.finish(); }
    imagesLen > (loadedIndex + 1) ? (loadedIndex++, loadImage()) : "";
    img = null;
  }
  function loadImage() {
    var img = new Image();
    img.crossorigin = "anonymous";
    img.src = json.list[loadedIndex];
    if (img.complete) {
      loadAfter(img);
    } else {
      img.onload = function () { loadAfter(this); }
    }
  }
  loadImage();
}